<?php
class Registrion{
	var $registrion_ID;
    var $studentId;
	var $courseId;
	var $approved;
    var $registrionDate;

    function Registrion(){
    }
	
	function setAll($registrion_ID,$studentId,$courseId,$approved,$registrionDate){
        $this->registrion_ID=$registrion_ID;
        $this->studentId=$studentId;
		$this->courseId=$courseId;
		$this->registrionDate=$registrionDate;
		$this->approved=$approved;
    }
	
    function getStudentId(){
        return $this->studentId;
    }  
	function getRegistrion_ID(){
        return $this->registrion_ID;
    }
	function getCourseId(){
        return $this->courseId;
    }
	function getRegistrionDate(){
        return $this->registrionDate;
    }
   	function getApproved(){
        return $this->approved;
    }
	
	function listRegistaredCourse($studentID) {
		$sql = "SELECT * FROM `courseregistration`, `course` WHERE `courseregistration`.`COURSE_ID` = `course`.`COURSE_ID` AND `STUDENT_ID` like '".$studentID."'";
		$query = mysql_query($sql); 

		$list = array();
		while($row=mysql_fetch_array($query)) { 
			$temp = new Registrion();
			$temp->setAll($row["REGISTRTION_ID"],$row["STUDENT_ID"],$row["COURSE_ID"],$row["APPROVED"],$row["REGISTRATION_DATE"]);
			$list[] = $temp;
		}
		return $list;
	}
}
?>